﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FySystem.Entity.Common
{
    public class IdsITO
    {
        public string[] ids {  get; set; }

        public string tag {  get; set; }

        public Guid[] gids()
        {
            try
            {
                Guid[] res = new Guid[ids.Length];
                for (int i = 0; i < ids.Length; i++)
                {
                    res[i] = Guid.Parse(ids[i]);
                }
                return res;
            }
            catch (Exception)
            {
                throw;
            }
        }
    }

    public static class IdsITOExtension
    {
        public static bool IsNull(this IdsITO idsITO)
        {
            if (idsITO == null)
                return true;
            else if (idsITO.ids == null)
                return true;
            else if (idsITO.ids.Length <= 0)
                return true;
            else
                return false;
        }
    }
}
